const Promise = function(executor){
	if(!(executor instanceof Function)){
		throw "executor类型错误！"
	}
	this.state = "pending";// 状态
	this.result = undefined;// 状态值
	try{
		executor(function(value){
			this.state = "fulfilled";
			this.result = value;
		}.bind(this),function(value){
			this.state = "rejected";
			this.result = value;
		}.bind(this));
	}catch (value){
		this.state = "rejected";
		this.result = value;
	}
	
};
export default Promise;